<template>
  <div class="container">
    <div class="package-card bg-white hd-shadow">
      <img src="../../../assets/upgrade20.jpeg" class="hd-img-responsive">
      <van-cell-group>
        <van-cell
          v-for="(item, index) in newlist" :key="index"
          :title="item.title"
          is-link
          @click="info(item)"
        />
      </van-cell-group>
    </div>
  </div>
</template>

<script>
export default {
  name: 'upgrade',
  data () {
    return {
      value: 1,
      newlist: []
    }
  },
  methods: {
    init () {
      this.$http({
        fun: 'ctcnewslist',
        requestType: 'get',
        cb: res => {
          console.log(res)
          this.newlist = res.results
          this.newlist.forEach(item => {
            console.log('111')
          })
        }
      })
    },
    info (item) {
      console.log(item.id)
      this.$router.push({
        name: 'news_detail',
        query: {
          'id': item.id
        }
      })
    }
  },

  mounted () {
    this.init()
  }
}
</script>

<style src="./index.css" scoped>
</style>
